package com.chengsi.service.impl;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chengsi.mapper.StudentMapper;
import com.chengsi.pojos.Chengsi;
import com.chengsi.pojos.Student;
import com.chengsi.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {

    @Autowired
    private Chengsi chengsi;
    @Override
    public Student getStudentById(Integer studentId) {
        return this.getById(studentId);
    }

    public boolean updateStudent(Student student){
        return this.updateById(student);
    }

    public boolean insertStudent(Student student){
        return this.save(student);
    }

    public boolean deleteStudent(Integer studentId){
        return this.removeById(studentId);
    }

    @Override
    public Chengsi getPersonalInfo() {
        return chengsi;
    }
}
